home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
LANG
/
C
/
LIB
/
DESK
/
CORE
/
Desk
/
h_doc
/
Time
< prev
next >
Wrap
Text File
|
1996-05-21
|
4KB
|
115 lines
/*
#### # # # #
# # # # # The FreeWare C library for
# # ## ### # # # # ### RISC OS machines
# # # # # # # # # # # ___________________________________
# # #### ### ## # # # #
# # # # # # # # # # Please refer to the accompanying
#### ### #### # # ##### # ### documentation for conditions of use
________________________________________________________________________
File: Desklib:Time.h
Author: Copyright © 1992, 1993, 1994 Jason Williams, Jason Howat
Version: 1.02 (22 May 1994)
Purpose: time handling
*/
#ifndef __Desk_Time_h
#define __Desk_Time_h
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __Desk_Core_h
#include "Desk.Core.h"
#endif
extern int Desk_Time_Monotonic(void);
/*
* Veneer for the Desk_OS_ReadMonotonicTime SWI
* Returns an integer representing the time since the computer was switched
* on, in centiseconds.
* Used with Desk_Wimp_PollIdle to poll every now and then, as in:
* time = Desk_Time_Monotonic();
* Desk_Wimp_PollIdle(mask, block, time + 100); // Pollidle for 1 sec (100cs)
*
* Can also be used to time things, i.e.
* time = Desk_Time_Monotonic();
* while (Desk_Time_Monotonic < time+100) |* wait *| ; // Wait for 1 second
*/
extern void Desk_Time_ConvertDateAndTime(const char *fivebyteblock, char *buffer,
int bufflen, const char *format);
/*
* Veneer for the Desk_OS_ConvertDateAndTime SWI.
* Uses the format string to convert the given time to text.
* Format codes: Field size:
* CS Centiseconds 2
* SE Seconds 2
* MI Minutes 2
* 12 Hours (12hr format) 2
* 24 Hours (24hr format) 2
* AM 'am' or 'pm' 2
* PM ditto 2
* WE Weekday varies
* W3 Weekday (3 chars) 3
* WN Weekday as number 1
* DY Day of the month 2
* ST 'st', 'nd', 'rd' or 'th' 2
* MO Month name varies
* M3 Month name (3 chars) 3
* MN Month as number 2
* CE Century 2
* YR Year within century 2
* WK Week number (Mon-Sun) 2
* DN Day of year 3
* 0 Insert an ASCII 0 byte 1
* % Insert a '%' 1
* Six time formats for ConvertDateAndTime are pre-defined for you:
*
* 1. Desk_Time_CTIME is equal to ctime() found in ANSI C <time.h> without
* the automatic \n inserted
*
* 2. Desk_Time_STANDARD is the default setting found on most Arcs and not
* the system variable <Sys$DateFormat>
*
* 3. Desk_Time_FANCYDATE is Sunday, 16th of January, 1994.
*
* 4. Desk_Time_SHORTTIME is 11:30pm
*
* 5. Desk_Time_LONGTIME is 11:30:12pm
*
* 6. Desk_Time_EUROTIME is 23:30:12
*/
#define Desk_Time_CTIME "%W3 %M3 %DY %z24:%MI:%SE %CE%YR"
#define Desk_Time_STANDARD "%24:%mi:%se %dy-%m3-%ce%yr"
#define Desk_Time_FANCYDATE "%WE, %zDY%ST of %MO, %CE%YR"
#define Desk_Time_SHORTTIME "%z12:%MI%pm"
#define Desk_Time_LONGTIME "%z12:%MI:%SE%pm"
#define Desk_Time_EUROTIME "%z24:%MI:%SE"
extern void Desk_Time_ConvertStandardDateAndTime(const char *fivebyteblock,
char *buffer, int bufflen);
/*
* Veneer for the Desk_OS_ConvertStandardDateAndTime SWI.
* Converts the given time into a string using the format string stored in
* Sys$DateFormat.
*/
#ifdef __cplusplus
}
#endif
#endif